<template>
    <ul class="contact-container">
        <li>
            <a :href="data.github" target="_blank">
                <div class="icon">
                    <Icon type="github" />
                </div>
                <span>{{ data.githubName }}</span>
            </a>
            <div class="pop">
                <img src="https://duyihome.oss-cn-beijing.aliyuncs.com/images/about/web-ewm.png" alt="">
            </div>
        </li>
        <li>
            <a :href="`mailto:${data.mail}`">
                <div class="icon">
                    <Icon type="home" />
                </div>
                <span>{{ data.mail }}</span>
            </a>
            <div class="pop">
                <img src="https://duyihome.oss-cn-beijing.aliyuncs.com/images/about/web-ewm.png" alt="">
            </div>
        </li>
        <li>
            <a href="">
                <div class="icon">
                    <Icon type="weixin" />
                </div>
                <span>保持专注</span>
            </a>
            <div class="pop">
                <img src="https://duyihome.oss-cn-beijing.aliyuncs.com/images/about/web-ewm.png" alt="">
            </div>
        </li>
        <li>
            <a href="">
                <div class="icon">
                    <Icon type="info" />
                </div>
                <span>警告</span>
            </a>
            <div class="pop">
                <img src="https://duyihome.oss-cn-beijing.aliyuncs.com/images/about/web-ewm.png" alt="">
            </div>
        </li>
    </ul>
</template>

<script>
import Icon from "@/components/Icon/index.vue"
import {mapState} from 'vuex'
export default {
    components: { Icon },
    computed:{
        ...mapState("setting",['data'])
    }
} 
</script>

<style lang="less" scoped>
@import "~@/styles/var.less";

.contact-container {
    width: 100%;
    list-style: none;
    padding: 20px;
    margin: 0;
    color: @gray;
    @itemHeight: 30px;

    li {
        height: @itemHeight;
        line-height: 30px;
        margin: 14px 0;
        position: relative;
        &:hover{
            .pop{
                transform: scaleY(1);
            }
        }
    }

    a {
        display: flex;
        align-items: center;
        position: relative;
        font-size: 14px;
    }

    .icon {
        font-size: 26px;
        width: 26px;
    }

    .pop {
        position: absolute;
        left: 0;
        bottom: @itemHeight + 5px;
        padding: 10px 15px;
        background: #fff;
        border-radius: 5px;
        transform: scaleY(0);
        transform-origin: center bottom;
        transition: 0.3s;
        img {
            width: 150px;
            height: 150px
        }

        &::after {
            content: "";
            position: absolute;
            left: 50%;
            transform: translateX(-50%) rotate(45deg);
            width: 8px;
            height: 8px;
            background: #fff;
            bottom: -4px;
        }
    }
}
</style>